package com.support.base

import androidx.lifecycle.MutableLiveData

//获取liveData
inline val <T> T.liveData: MutableLiveData<T> get() = MutableLiveData(this)

//获取RXObj
inline val <T> T.obs: RXObj<T> get() = RXObj(this)

//中缀运算符,set LiveData的值
infix fun <T> MutableLiveData<T>.set(value: T) {
    this.value = value
}

//中缀运算符,post LiveData的值
infix fun <T> MutableLiveData<T>.post(value: T) {
    this.postValue(value)
}

//中缀运算符,判断LiveData的值是否相等
infix fun <T> MutableLiveData<T>.equals(value: T): Boolean {
    return this.value == value
}

